Electronic device having coupler for tapping antenna signals

ABSTRACT

An electronic device may be provided with wireless circuitry. Control circuitry may be used to adjust transmit power levels for wireless signals, may be used to tune antennas, and may be used to adjust other settings for the wireless circuitry. The electronic device may have a coupler interposed between an antenna and wireless transceiver circuitry. The coupler and a receiver within the transceiver circuitry may be used to make measurements on tapped antenna signals such as transmitted signals and signals reflected from the antenna. By analyzing the tapped antenna signals, S-parameter phase and magnitude information may be gathered that provides insight into whether the electronic device is operating properly and whether an external object is adjacent to the antenna. If an external object is present, the electronic device may limit wireless transmit power and may adjust tunable components in the antenna to compensate for detuning from the external object.

BACKGROUND

This relates generally to electronic devices and, more particularly, toelectronic devices with wireless communications circuitry.

Electronic devices often include wireless communications circuitry. Forexample, cellular telephones, computers, and other devices often containantennas and wireless transceivers for supporting wirelesscommunications.

It can be challenging to assemble and operate wireless electronicdevices. During assembly, it may be difficult to determine whetherassembly operations have been performed correctly. If care is not taken,antennas may not be properly interconnected with other portions of adevice. Calibration steps may require the extensive use of testequipment and may take more time than desired. During operation of awireless device by a user, wireless performance can be affected bychanges in the environment of the wireless device.

It would therefore be desirable to be able to provide improved ways forcharacterizing the operation of wireless devices in various operatingenvironments.

SUMMARY

An electronic device may be provided with wireless circuitry fortransmitting and receiving wireless signals. Control circuitry may beused to adjust transmit power levels for the wireless signals, may beused to tune antennas, and may be used to adjust other settings for thewireless circuitry.

The electronic device may have one or more antennas. A coupler may beinterposed between an antenna and wireless transceiver circuitry.Switching circuitry in the coupler may be used to allow the coupler tosample signals flowing from the transceiver circuitry and the antennaand to sample signals flowing from the antenna to the transceivercircuitry.

Using the coupler and using a receiver within the transceiver circuitry,a processor such as a baseband processor integrated circuit may makemeasurements on tapped antenna signals such as transmitted signals andsignals reflected from the antenna. By analyzing the tapped antennasignals, S-parameter phase and magnitude information may be gatheredthat provides insight into whether the electronic device is operatingproperly and whether an external object is adjacent to the antenna. Ifan external object is present, the electronic device may limit wirelesstransmit power and may adjust tunable components in the antenna tocompensate for detuning from the external object. The tapped antennasignals may be used in calibrating the wireless circuitry and may beused as part of a self-test routine.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a perspective view of an illustrative electronic device withwireless communications circuitry in accordance with an embodiment.

FIG. 2 is a schematic diagram of an illustrative electronic device withwireless communications circuitry in accordance with an embodiment.

FIG. 3 is a diagram of illustrative wireless circuitry in accordancewith an embodiment.

FIG. 4 is a diagram of an illustrative antenna of the type that may beinfluenced by the presence of an external object in the vicinity of theantenna in accordance with an embodiment.

FIG. 5 is a circuit diagram of illustrative circuitry that may be usedto gather tapped antenna signals in accordance with an embodiment.

FIG. 6 is a graph in which the magnitude of an S-parameter associatedwith an antenna port has been plotted as a function of frequency inaccordance with an embodiment.

FIG. 7 is a graph in which the phase of the S-parameter has been plottedas a function of frequency in accordance with an embodiment.

FIG. 8 is a table showing illustrative measured antenna feedback valuesand associated operating modes for an electronic device in accordancewith an embodiment.

FIG. 9 is a flow chart of illustrative steps involved in gathering phaseand magnitude information for antenna signals in a device and takingappropriate action during operation of the device in accordance with anembodiment.

FIG. 10 is a graph showing how tapped antenna signals can be used incalibrating wireless circuitry in accordance with an embodiment.

FIG. 11 is a flow chart of illustrative steps involved in usingmeasurements of tapped antenna signals to calibrate wireless circuitryin an electronic device in accordance with an embodiment.

FIG. 12 is a flow chart of illustrative steps involved in usingmeasurements of tapped antenna signals to evaluate whether a device isfunctioning properly in accordance with an embodiment.

DETAILED DESCRIPTION

An electronic device such as electronic device 10 of FIG. 1 may containwireless circuitry. A coupler may be used to tap into a path between aradio-frequency transceiver and an associated antenna. The output fromthe tap can be used to measure antenna signals being transmitted to theantenna and antenna signals being reflected from the antenna. Processingcircuitry within the electronic device may process the tapped antennasignals to produce phase and magnitude information (e.g., the phase andmagnitude of an S-parameter such as S11, where network port 1corresponds to the antenna port for the antenna, the phase and magnitudeof antenna impedance, etc.). The phase and magnitude information can beused in evaluating device operation during testing, can be used duringcalibration operations, and can be used in real-time control of wirelesscircuitry in a device.

Device 10 may contain wireless communications circuitry that operates inlong-range communications bands such as cellular telephone bands andwireless circuitry that operates in short-range communications bandssuch as the 2.4 GHz Bluetooth® band and the 2.4 GHz and 5 GHz WiFi®wireless local area network bands (sometimes referred to as IEEE 802.11bands or wireless local area network communications bands). Device 10may also contain wireless communications circuitry for implementingnear-field communications, light-based wireless communications,satellite navigation system communications, or other wirelesscommunications.

Electronic device 10 may be a computing device such as a laptopcomputer, a computer monitor containing an embedded computer, a tabletcomputer, a cellular telephone, a media player, or other handheld orportable electronic device, a smaller device such as a wrist-watchdevice, a pendant device, a headphone or earpiece device, a deviceembedded in eyeglasses or other equipment worn on a user's head, orother wearable or miniature device, a television, a computer displaythat does not contain an embedded computer, a gaming device, anavigation device, an embedded system such as a system in whichelectronic equipment with a display is mounted in a kiosk or automobile,equipment that implements the functionality of two or more of thesedevices, or other electronic equipment. In the illustrativeconfiguration of FIG. 1, device 10 is a portable device such as acellular telephone, media player, tablet computer, or other portablecomputing device. Other configurations may be used for device 10 ifdesired. The example of FIG. 1 is merely illustrative.

In the example of FIG. 1, device 10 includes a display such as display14. Display 14 has been mounted in a housing such as housing 12. Housing12, which may sometimes be referred to as an enclosure or case, may beformed of plastic, glass, ceramics, fiber composites, metal (e.g.,stainless steel, aluminum, etc.), other suitable materials, or acombination of any two or more of these materials. Housing 12 may beformed using a unibody configuration in which some or all of housing 12is machined or molded as a single structure or may be formed usingmultiple structures (e.g., an internal frame structure, one or morestructures that form exterior housing surfaces, etc.).

Display 14 may be a touch screen display that incorporates a layer ofconductive capacitive touch sensor electrodes or other touch sensorcomponents (e.g., resistive touch sensor components, acoustic touchsensor components, force-based touch sensor components, light-basedtouch sensor components, etc.) or may be a display that is nottouch-sensitive. Capacitive touch screen electrodes may be formed froman array of indium tin oxide pads or other transparent conductivestructures.

Display 14 may include an array of display pixels formed from liquidcrystal display (LCD) components, an array of electrophoretic displaypixels, an array of plasma display pixels, an array of organiclight-emitting diode display pixels, an array of electrowetting displaypixels, or display pixels based on other display technologies.

Display 14 may be protected using a display cover layer such as a layerof transparent glass or clear plastic. Openings may be formed in thedisplay cover layer. For example, an opening may be formed in thedisplay cover layer to accommodate a button such as button 16. Anopening may also be formed in the display cover layer to accommodateports such as speaker port 18. Openings may be formed in housing 12 toform communications ports (e.g., an audio jack port, a digital dataport, etc.).

A schematic diagram showing illustrative components that may be used indevice 10 is shown in FIG. 2. As shown in FIG. 2, device 10 may includecontrol circuitry such as storage and processing circuitry 30. Storageand processing circuitry 30 may include storage such as hard disk drivestorage, nonvolatile memory (e.g., flash memory or otherelectrically-programmable-read-only memory configured to form a solidstate drive), volatile memory (e.g., static or dynamicrandom-access-memory), etc. Processing circuitry in storage andprocessing circuitry 30 may be used to control the operation of device10. This processing circuitry may be based on one or moremicroprocessors, microcontrollers, digital signal processors, basebandprocessor integrated circuits, application specific integrated circuits,etc.

Storage and processing circuitry 30 may be used to run software ondevice 10, such as internet browsing applications,voice-over-internet-protocol (VOIP) telephone call applications, emailapplications, media playback applications, operating system functions,etc. To support interactions with external equipment, storage andprocessing circuitry 30 may be used in implementing communicationsprotocols. Communications protocols that may be implemented usingstorage and processing circuitry 30 include internet protocols, wirelesslocal area network protocols (e.g., IEEE 802.11 protocols—sometimesreferred to as WiFi®), protocols for other short-range wirelesscommunications links such as the Bluetooth® protocol, cellular telephoneprotocols, MIMO protocols, antenna diversity protocols, etc.

Device 10 may include input-output circuitry 44. Input-output circuitry44 may include input-output devices 32. Input-output devices 32 may beused to allow data to be supplied to device 10 and to allow data to beprovided from device 10 to external devices. Input-output devices 32 mayinclude user interface devices, data port devices, and otherinput-output components. For example, input-output devices may includetouch screens, displays without touch sensor capabilities, buttons,joysticks, click wheels, scrolling wheels, touch pads, key pads,keyboards, microphones, cameras, buttons, speakers, status indicators,light sources, audio jacks and other audio port components, digital dataport devices, light sensors, motion sensors (accelerometers),capacitance sensors, proximity sensors (e.g., a capacitive proximitysensor and/or an infrared proximity sensor), magnetic sensors, connectorport sensors that determine whether a connector such as an audio jackand/or digital data connector have been inserted in a connector port indevice 10, a connector port sensor or other sensor that determineswhether device 10 is mounted in a dock, other sensors for determiningwhether device 10 is coupled to an accessory, and other sensors andinput-output components.

Input-output circuitry 44 may include wireless communications circuitry34 for communicating wirelessly with external equipment. Wirelesscommunications circuitry 34 may include radio-frequency (RF) transceivercircuitry formed from one or more integrated circuits, power amplifiercircuitry, low-noise input amplifiers, passive RF components, one ormore antennas, transmission lines, and other circuitry for handling RFwireless signals. Wireless signals can also be sent using light (e.g.,using infrared communications).

Wireless communications circuitry 34 may include radio-frequencytransceiver circuitry 90 for handling various radio-frequencycommunications bands. For example, circuitry 34 may include transceivercircuitry 36, 38, and 42.

Transceiver circuitry 36 may be wireless local area network transceivercircuitry that may handle 2.4 GHz and 5 GHz bands for WiFi® (IEEE802.11) communications and that may handle the 2.4 GHz Bluetooth®communications band.

Circuitry 34 may use cellular telephone transceiver circuitry 38 forhandling wireless communications in frequency ranges such as a lowcommunications band from 700 to 960 MHz, a midband from 1710 to 2170MHz, and a high band from 2300 to 2700 MHz or other communications bandsbetween 700 MHz and 2700 MHz or other suitable frequencies (asexamples). Circuitry 38 may handle voice data and non-voice data.

Wireless communications circuitry 34 can include circuitry for othershort-range and long-range wireless links if desired. For example,wireless communications circuitry 34 may include 60 GHz transceivercircuitry, circuitry for receiving television and radio signals, pagingsystem transceivers, near field communications (NFC) circuitry, etc.

Wireless communications circuitry 34 may include satellite navigationsystem circuitry such as global positioning system (GPS) receivercircuitry 42 for receiving GPS signals at 1575 MHz or for handling othersatellite positioning data. In WiFi® and Bluetooth® links and othershort-range wireless links, wireless signals are typically used toconvey data over tens or hundreds of feet. In cellular telephone linksand other long-range links, wireless signals are typically used toconvey data over thousands of feet or miles.

Wireless communications circuitry 34 may include antennas 40. Antennas40 may be formed using any suitable antenna types. For example, antennas40 may include antennas with resonating elements that are formed fromloop antenna structures, patch antenna structures, inverted-F antennastructures, slot antenna structures, planar inverted-F antennastructures, helical antenna structures, hybrids of these designs, etc.If desired, one or more of antennas 40 may be cavity-backed antennas.Different types of antennas may be used for different bands andcombinations of bands. For example, one type of antenna may be used informing a local wireless link antenna and another type of antenna may beused in forming a remote wireless link antenna.

Transmission line paths may be used to couple antenna structures 40 totransceiver circuitry 90. Transmission lines in device 10 may includecoaxial cable paths, microstrip transmission lines, striplinetransmission lines, edge-coupled microstrip transmission lines,edge-coupled stripline transmission lines, transmission lines formedfrom combinations of transmission lines of these types, etc. Filtercircuitry, switching circuitry, impedance matching circuitry, and othercircuitry may be interposed within the transmission lines, if desired.

Device 10 may contain multiple antennas 40. One or more of the antennasmay be blocked by a user's body or other external object while one ormore other antennas are not blocked. If desired, control circuitry 30may be used to select an optimum antenna to use in device 10 in realtime (e.g., an optimum antenna to transmit signals, etc.). Controlcircuitry 30 may, for example, make an antenna selection based oninformation on received signal strength, based on sensor data (e.g.,information from a proximity sensor indicating which of multipleantennas may be blocked by an external object), based on tapped antennasignals from a coupler (e.g., phase and/or magnitude information), orbased on other information.

As shown in FIG. 3, transceiver circuitry 90 in wireless circuitry 34may be coupled to antenna structures 40 using paths such as path 92.Wireless circuitry 34 may be coupled to control circuitry 30. Controlcircuitry 30 may be coupled to input-output devices 32. Input-outputdevices 32 may supply output from device 10 and may receive input fromsources that are external to device 10.

To provide antenna structures 40 with the ability to covercommunications frequencies of interest, antenna structures 40 may beprovided with circuitry such as filter circuitry (e.g., one or morepassive filters and/or one or more tunable filter circuits). Discretecomponents such as capacitors, inductors, and resistors may beincorporated into the filter circuitry. Capacitive structures, inductivestructures, and resistive structures may also be formed from patternedmetal structures (e.g., part of an antenna). If desired, antennastructures 40 may be provided with adjustable circuits such as tunablecomponents 102 to tune antennas over communications bands of interest.Tunable components 102 may include tunable inductors, tunablecapacitors, or other tunable components. Tunable components such asthese may be based on switches and networks of fixed components,distributed metal structures that produce associated distributedcapacitances and inductances, variable solid state devices for producingvariable capacitance and inductance values, tunable filters, or othersuitable tunable structures. During operation of device 10, controlcircuitry 30 may issue control signals on one or more paths such as path88 that adjust inductance values, capacitance values, or otherparameters associated with tunable components 102, thereby tuningantenna structures 40 to cover desired communications bands.

Path 92 may include one or more transmission lines. As an example,signal path 92 of FIG. 3 may be a transmission line having a positivesignal conductor such as line 94 and a ground signal conductor such asline 96. Lines 94 and 96 may form parts of a coaxial cable or amicrostrip transmission line (as examples). A matching network formedfrom components such as inductors, resistors, and capacitors may be usedin matching the impedance of antenna structures 40 to the impedance oftransmission line 92. Matching network components may be provided asdiscrete components (e.g., surface mount technology components) or maybe formed from housing structures, printed circuit board structures,traces on plastic supports, etc. Components such as these may also beused in forming filter circuitry in antenna structures 40.

Transmission line 92 may be coupled to antenna feed structuresassociated with antenna structures 40. As an example, antenna structures40 may form an inverted-F antenna, a slot antenna, a hybrid inverted-Fslot antenna or other antenna having an antenna feed with a positiveantenna feed terminal such as terminal 98 and a ground antenna feedterminal such as ground antenna feed terminal 100. Positive transmissionline conductor 94 may be coupled to positive antenna feed terminal 98and ground transmission line conductor 96 may be coupled to groundantenna feed terminal 92. Other types of antenna feed arrangements maybe used if desired. The illustrative feeding configuration of FIG. 3 ismerely illustrative.

FIG. 4 is a diagram of illustrative inverted-F antenna structures thatmay be used in implementing antenna 40 for device 10. Inverted-F antenna40 of FIG. 4 has antenna resonating element 106 and antenna ground(ground plane) 104. Antenna resonating element 106 may have a mainresonating element arm such as arm 108. The length of arm 108 may beselected so that antenna 40 resonates at desired operating frequencies.For example, if the length of arm 108 may be a quarter of a wavelengthat a desired operating frequency for antenna 40. Antenna 40 may alsoexhibit resonances at harmonic frequencies.

Main resonating element arm 108 may be coupled to ground 104 by returnpath 110. Tunable component(s) 102 (e.g., an adjustable inductor, anadjustable capacitor, and/or other adjustable component) may beinterposed in path 110 or may be incorporated elsewhere in antenna 40.Antenna feed 112 may include positive antenna feed terminal 98 andground antenna feed terminal 100 and may run parallel to return path 110between arm 108 and ground 104. If desired, inverted-F antennas such asillustrative antenna 40 of FIG. 4 may have more than one resonating armbranch (e.g., to create multiple frequency resonances to supportoperations in multiple communications bands) or may have other antennastructures (e.g., parasitic antenna resonating elements, tunablecomponents to support antenna tuning, etc.).

Antennas such as antenna 40 of FIG. 4 may be affected by the presence ofnearby objects. For example, an antenna may exhibit an expectedfrequency response when device 10 is operated in free space in theabsence of nearby external objects such as external object 114, but mayexhibit a different frequency response when device 10 is operated in thepresence of external object 114. The magnitude of the distance betweenexternal object 114 and antenna 40 may also influence antennaperformance.

External objects such as object 114 may include a user's body (e.g., auser's head, a user's leg, or other user body part), may include a tableor other surface on which device 10 is resting, may include dielectricobjects, may include conductive objects, and/or may include otherobjects that affect wireless performance (e.g., by loading antenna 40 indevice 10 and thereby affecting antenna impedance for antenna 40).

When an external object such as object 114 is brought into the vicinityof antenna 40 (e.g., when object 114 is within 10 cm of antenna 40, whenobject 114 is within 1 cm of antenna 40, when object 114 is within 1 mmof antenna 40, or when distance D between antenna 40 and object 114 hasother suitable values), antenna 40 may exhibit an altered frequencyresponse (e.g., antenna 40 may be detuned because the impedance of theantenna has been changed due to loading from object 114). Using phaseand magnitude information from tapped antenna signals, device 10 (e.g.,processor 30) may control the operation of wireless circuitry 34accordingly. For example, when it is determined from tapped antennasignals that antenna 40 has been detuned due to the presence of externalobject 114, tunable components 102 may be adjusted to compensate for thedetuning. As another example, if it is determined that an externalobject such as a user's body is present, the maximum transmit power thatis used by device 10 in transmitting signals through antenna 40 can bereduced.

FIG. 5 is a diagram of illustrative wireless circuitry based on multipleantennas 40. As shown in FIG. 5, antennas 40 may include a first antennasuch as antenna 40A and a second antenna such as antenna 40B. Antennas40 may be coupled to transceiver circuitry 90 and other circuitry suchas baseband processor 132. Transceiver circuitry 90 may includereceivers and/or transmitters. For example, transceiver circuitry 90 mayinclude a first transceiver such as transceiver 90A (e.g., receiver 128and transmitter 130, which may be coupled to path 124 via duplexer 152or other circuitry), a second transceiver such as transceiver 90B (e.g.,a receiver), and a third transceiver such as transceiver 90C (e.g., areceiver).

Circuitry 144 may be interposed between path 124 and transceivercircuitry 90. Paths 124 and path 126 may be coupled to antennas 40A and40B using switching circuitry 120. Switching circuitry 120 may be, forexample, a double-pole-double-throw switch that is controlled by controlsignals at switch control input 122. In a first state, switch 120couples antenna 40A to path 124 and couples antenna 40B to path 126. Ina second state, switch 120 couples antenna 40B to path 124 and couplesantenna 40A to path 126.

Antennas 40A and 40B may be located at opposing upper and lower ends ofelectronic device 10 and housing 12 of FIG. 1 or may be locatedelsewhere in device 10. Control circuitry in device 10 may use receivedsignal strength information, sensor information, and/or antenna feedbackinformation (e.g., antenna impedance information) to determine whetherswitch 120 should be placed in the first state or the second state. Forexample, the lower antenna in device 10 may be used as a primary antennato transmit and receive signals while the upper antenna in device 10 isused as a secondary antenna that only receives signals. When receivedsignal strength with the lower antenna drops below a threshold amount orwhen other criteria are satisfied, the state of switch 120 may bechanged so that the upper antenna is switched into use in place of thelower antenna (as an example).

Circuitry 144 may include coupler 136. Coupler 136 may be used to tapantenna signals flowing between transceiver circuitry 90 and antennas40. Coupler 136 has internal terminals A and B and has externalterminals C and D. Switching circuitry in coupler 136 can direct tappedsignals to terminals C and D. Terminals C and D are coupled to tappedantenna signal path 162. Path 162 may be coupled to a receiver intransceiver circuitry 90, so that tapped antenna signals can be measuredand processed. In the example of FIG. 5, receiver 90C is being used toreceive signals on path 162. If desired, switching circuitry (see, e.g.,optional switch 180) or other circuitry may be used to route signalsfrom path 162 to other receivers in transceiver circuitry 90 (see, e.g.,receiver 128 and receiver 90B). The use of a dedicated receiver such asreceiver 90C for receiving tapped antenna signals from path 162 ismerely illustrative.

Using circuitry 144, antenna impedance information for the currentlyactive antenna can be gathered. The impedance information may begathered by gathering S-parameter information such as the phase andmagnitude of S₁₁ (where network port 1 in this example is associatedwith the currently active antenna in antennas 40). For example, ifantenna 40A is the currently active antenna associated with transmitter130, transmitter 130 may transmit antenna signals to antenna 40A usingoutput path 150, power amplifier 142, duplexer 152, and path 154.Coupler 136 may be used to route a tapped version of the transmittedsignals and a tapped version of reflected signals from antenna 40A topath 162. Receiver 90C and baseband processor 132 can process thesetapped signals to produce information on the phase of S11 at output 170and the magnitude of S11 at output 172. Processor 132 may also retainthis information internally. Processor 132 and/or other processingcircuitry 30 in device 10 may take appropriate action based on thesignal values at outputs 170 and/or 172 and may, if desired, furtherprocess these signal values (e.g., to produce real and imaginary antennaimpedance information, etc.).

As shown in FIG. 5, coupler 136 may have switching circuitry such asswitches 156 and 158. Control signals from baseband processor 132 (e.g.,control signals from control output 138) or other control signals may besupplied to control path 160 to adjust the states of switches 156 and158. Switch 156 may be directed to couple internal coupler terminal A tocoupler output terminal C or to termination 164 (e.g., a 50 ohm groundtermination). Switch 158 may be directed to couple internal couplerterminal B to coupler output terminal D or to termination 166 (e.g., a50 ohm ground termination). When it is desired to measure transmittedantenna signals flowing from path 154 to path 124 through coupler 136,switch 158 is directed to short terminal B to terminal D while switch156 connects terminal A to termination 164, so that receiver 90Cmeasures a tapped version of the transmitted signal on path 162. When itis desired to measure received antenna signals flowing from path 124 topath 154 through coupler 136 (e.g., reflected signals from antenna 40Awhen antenna 40A is the active antenna), switch 156 is directed to shortterminal A to terminal C while switch 158 connects terminal B totermination 166, so that receiver 90C measures the tapped version of thereflected signal on path 162. The magnitude of S₁₁ is given by the logof the reflected signal divided by the forward (transmitted) signal andis supplied by processor 132 to output 172. The phase of S₁₁ is suppliedto output 170.

Baseband processor 132 may be an integrated circuit that is coupled toprocessing circuitry in device 10 via paths such as path 134. Duringnormal operation, baseband processor 132 receives data to be transmittedfrom circuits in control circuitry 30 via path 134 and provides receiveddata to circuits in control circuitry 30 via path 134. During antennaimpedance data gathering operations, baseband processor 132 can usetransceiver circuitry 90 and the other circuitry of FIG. 5 to extractreal and imaginary antenna impedance information for antennas 40. Forexample, baseband processor 132 can use transceiver circuitry 90 andcoupler 136 to gather phase and magnitude information for tapped antennasignals (e.g., S₁₁ phase and magnitude information). Based on thisinformation and other information (e.g., received signal strengthinformation, sensor data from a proximity sensor and other sensors,etc.), baseband processor 132 or other control circuitry in device maygenerate control signals (see, e.g., control signal output 138 of FIG.5). The control signals may be used in tuning antenna 40A and/or 40B(e.g., by adjusting tunable components 102), may be used in switchingone or more antennas into use (e.g., by supplying a control signal to aswitch control input such as input 122 of double-pole-double-throwantenna switch 120), may be used in controlling output power from atransmitter in transceiver circuitry 90 such as transmitter 130, may beused in controlling output power by adjusting power amplifier gain withcontrol signals applied to control input 140 of power amplifier 142, ormay otherwise be used in controlling the operation of device 10.Information on paths 170 and 172 may also be used in taking otheractions (e.g., issuing alerts, making pass/fail decisions during testingas part of a manufacturing process or in-store diagnostics routine beingrun on device 10, etc.).

Antenna impedance information gathered using coupler 136 and the othercircuitry of FIG. 5 may be used to perform in-factory diagnostics, toperform in-store diagnostics (service center diagnostics), to calibratethe transmitter circuitry and/or other wireless circuitry in device 10,and to control the operation of device 10 in real time.

Consider, as an example, in-factory or in-store diagnostics. The properfunctioning of the wireless circuitry of device 10 can be verified usingantenna impedance data. If an antenna connector, a transmission line foran antenna, a circuit that is coupled to an antenna, or other circuitassociated with handling antenna signals in device 10 is faulty, theantenna impedance data gathered using coupler 136 will be affected.Accordingly, phase and magnitude information of the type produced onoutputs 170 and 172 may be used to check whether device 10 isfunctioning properly (e.g., whether cables and other signal paths areproperly attached to each other within housing 12, whether transceivercircuitry and switches are functioning properly, whether antennastructures have been damaged or are operating satisfactorily, etc.).

As another example, consider real time operation of device 10. Asdescribed in connection with FIG. 4, the impedance of antenna 40 can beinfluenced by the operating environment of antenna 40. As an example,antenna 40 may function differently when operated in the absence ofexternal objects than when operated in the vicinity of external object114. Moreover, different types of external objects 114 (e.g., differentparts of a user's body, inanimate objects, conductive structures, etc.)may affect antenna operation differently. To ensure that antenna 40operates as desired, real time antenna impedance data (and/or relatedinformation such as the magnitude and phase of S11 at outputs 170 and172) can be evaluated by processor 132 or other processing circuitry indevice 10.

FIGS. 6 and 7 are graphs of illustrative S11 magnitude and phaseinformation from outputs 172 and 170, respectively. The data in thesegraphs illustrates the type of information that may be gathered whenoperating wireless circuitry 34 under various different operatingconditions. In this example, curve 200 of FIG. 6 represents themagnitude of S₁₁ (output 172) during normal operation of antenna 40 inthe absence of external object 114. Curve 206 represents the phase ofS₁₁ (output 170) during normal operation of antenna 40 in the absence ofexternal object 144. When object 114 (e.g., a part of a user's body) isat a first distance D (e.g., a distance of 5 cm) from antenna 40, theoperation of antenna 40 is detuned due to loading from object 114, asshown by curve 202 of FIG. 6 and curve 208 of FIG. 7. In this caseoutput 172 changes from M1 (normal operation; antenna is unloaded) to M2(slightly loaded) and output 170 changes from PH1 (normal operation;antenna is unloaded) to PH2 (slightly loaded). When object 114 is at asecond distance D (e.g., a distance of 1 mm), output 172 changes from M2(slightly loaded) to M3 (heavily loaded) and output 170 changes from PH2(slightly loaded) to PH3 (heavily loaded).

As shown in FIGS. 6 and 7, phase data tends to be more sensitive toloading from external objects than magnitude data, so PH2 changessignificantly from PH1, whereas M2 does not change significantly fromM1. Under heavy loading, however, M3 changes significantly from M2. Byanalyzing both phase and magnitude data, device 10 can accuratelyevaluate the current operating environment of device 10 (e.g., theloading of antenna 40) and can take corrective actions. Under slightloading conditions, antenna 40 may be only slightly detuned (see, e.g.,the resonance of curve 202 in FIG. 6, which is shifted to a frequencythat is only slightly below normal operating frequency band f1 of curve200), so no corrective tuning of antenna 40 may be needed. Under heavyloading conditions, however, antenna 40 may become significantly detuned(as shown by curve 204 of FIG. 6), thereby requiring compensating tuningof tunable elements 102 in antenna 40. Once elements 102 are tuned, thefrequency response to the antenna will return to normal curve 200.

In general, processing circuitry such as baseband processor 132 or otherprocessing circuitry in device 10 may determine how severely antenna 40has been affected by external object 114 and/or may deduce the nature ofexternal object 114 using phase and magnitude information (e.g., todetermine distance D of object 114 and/or to determine what part of auser's body is present in the vicinity of antenna 40 based on theloading characteristics of that body part and/or to determine whetherexternal object 114 is associated with a user's body or is associatedinstead with an inanimate object such as a table). Sensor data (e.g.,accelerometer data, audio data, proximity sensor data, etc.) and data onthe current operating mode of device 10 (e.g., whether or not the earspeaker of device 10 is being actively used) may also be processed toprovide additional information on the current operating environment ofdevice 10 and the performance of antenna 40. Based on this information,the processing circuitry of device 10 can take suitable action. Forexample, the processing circuitry of device 10 may adjust antennatuning, may set appropriate maximum transmit power values to establishappropriate transmit power limits, may perform antenna switching, etc.

FIG. 8 is a table illustrating how device 10 may operate under threedifferent operating scenarios. In the scenario illustrated in the firstrow of the table of FIG. 8, the phase and magnitude data from outputs170 and 174 is normal, so device 10 operates antenna 40 and transceivercircuitry 90 normally. The tuning of tunable components 102 is set toits normal state and the transmit power from transmitter 130 and poweramplifier 142 is not restricted. Transmit power may be increased ordecreased based on received instructions (transmit power commands) froma wireless base station and need not be limited due to the presence ofan external object in the vicinity of device 10.

In the scenario illustrated in the second row of the table of FIG. 8,the measured phase signal on output 170 has changed from PH1 to PH2 andthe measured magnitude signal on output 172 has changed from M1 to M2.Under these conditions (large phase mismatch and small magnitudemismatch), processor 132 can conclude that external object 114 is withina first distance D1 of antenna 40. As a result, the processor can reducethe maximum permitted output power from antenna 40 to ensure thatregulatory limits on transmitted power are satisfied. Antenna 40 willnot be significantly detuned by the presence of object 114, so no tuningadjustments are made to antenna 40.

In the scenario illustrated in the third row of the table of FIG. 8,both the phase and magnitude are significantly mismatched, so device 10can conclude that external object 114 is within a second distance D2that is smaller than D1. Device 10 can also conclude that antenna 40will be detuned significantly from its desired operating state unlesscompensating adjustments are made. As a result, processor 132 may limitthe maximum transmit power from antenna 40 (e.g., a maximum power levelmay be established that is lower than the maximum power permitted duringoperation in the scenario of the second row of the FIG. 8 table) and mayadjust tunable antenna components 102 to compensate antenna 40 for theantenna detuning that would otherwise be experienced by antenna 40. Asan example, if detuning results in a lowered resonant frequency forantenna 40 as illustrated by detuned curve 204 of FIG. 6, components 102may be adjusted to raise the resonant frequency of antenna 40 back tothe position of curve 200 (e.g., by adjusting an adjustable inductor inreturn path 110 to a lower inductor value).

Illustrative steps involved in performing these types of antennaevaluation and wireless circuit adjustment operations are shown in FIG.9. During operation of device 10, a user may use wireless circuitry 34to transmit and receive wireless signals. Using coupler 136, tappedantenna signals may be gathered. This allows processor 132 to producereal and imaginary impedance information (and/or related informationsuch as S₁₁ phase and magnitude data) for the currently active antenna(step 212). During the operations of step 214, the gathered antenna datacan be evaluated and suitable actions taken by device 10 in real time.For example, maximum transmit powers may be adjusted and antenna 40 maybe tuned, as described in connection with FIG. 8. Processing may thenloop back to step 212, as illustrated by line 216.

FIG. 10 is a graph showing how gathered tapped antenna data (e.g., S₁₁magnitude information in the example of FIG. 10) may be used duringcalibration operations and diagnostic operations. In the FIG. 10example, curve 218 corresponds to a normal expected magnitude signalfrom output 172 covering a range of operating frequencies including lowband frequencies around frequency f1 and high band frequencies. Ifwireless circuitry 34 contains a fault (e.g., a disconnected connector,a crack in an antenna trace or signal line trace, a loose solder jointin an antenna or antenna signal path, or other antenna-related failurethat arises during manufacturing or during normal use of device 10),curve 218 will be affected and may exhibit a characteristic such ascurve 220. During assembly of device 10 and/or during a diagnosticsroutine run by device 10 in a store or other service facility associatedwith the manufacturer of device 10 when device 10 is returned by theuser for servicing, the presence of an abnormal antenna response curvesuch as curve 220 may be detected by processor 132 and appropriateaction taken.

The graph of FIG. 10 shows how antenna measurements made using coupler136 and processor 132 may also be used during calibration operations. Asindicated by illustrative calibration measurements 222, wirelesscircuitry 24 may be calibrated by using coupler 136 to make a series ofmeasurements at different frequencies and transmit powers. The resultsof these measurements may be gathered using coupler 136 and processor132 (e.g., as S₁₁ magnitude information on output 172). To ensurecalibration accuracy, coupler 136 can first be calibrated using anexternal power meter (e.g., a power meter plugged into a port in path124 or other suitable antenna signal path). Following calibration ofcoupler 136, processor 132 can direct transmitter 130 to transmitsignals over a range of output power levels (e.g., in 2 dB powerincrements) and output frequencies. At each different set of transmitpower and frequency settings, a different corresponding tapped antennasignal can be captured using coupler 136. Although the entirecalibration process may be time consuming (e.g., taking many minutes oreven hours to complete), no external equipment (e.g., no external vectornetwork analyzer) need be used to calibrate device 10 across allfrequencies and power levels of interest. As a result of this ability toself-calibrate devices 10, numerous devices 10 can be calibrated in afactory in parallel without requiring the use of costly and complex testequipment.

FIG. 11 is a flow chart of illustrative steps involved in calibratingdevice 10 in this way. At step 224, wireless circuit components forcircuitry 34 may be assembled. For example, cables and othertransmission line structures may be plugged into connectors, antennastructures may be fabricated, and, if desired, some or all of the restof wireless circuitry 34 and device 10 can be assembled. Assemblyoperations may be performed at the device level (e.g., device 10 may befabricated in its entirety) or at the board level (e.g., one or moreprinted circuits may be populated with antenna components, transceivercomponents, and other wireless circuitry 34 without completing thefabrication of device 10).

Following component assembly operations at step 224, an external powermeter may, at step 226, be attached to an antenna port in device 10(e.g., a port associated with antenna 40A). As an example, a power meterprobe may be coupled to a connector adjacent to antenna 40A thatmomentarily disconnects antenna 40A while coupling the probe into thesignal path between the antenna and transceiver.

While the power meter is attached, processor 132 may use transmitter 130to transmit radio-frequency signals at a particular power level (step228). The power meter captures the power and processor 132 uses coupler136 to capture a tapped version of the transmitted power. By comparingthe tapped signal reading to the power meter reading, coupler 136 may becalibrated.

Accordingly, at step 230, wireless circuitry 34 can be calibrated acrossnumerous different operating frequencies and output power levels as partof a calibration routine that is run at step 230. As an example, anoperator at a factory or other establishment may initiate a calibrationroutine that runs on processing circuitry 132 or other processingcircuitry for device 10. The calibration routine may systematicallyalter the transmit frequency and transmit power of transmitter 130 whilegathering tapped antenna signals using coupler 136 (e.g., magnitudeinformation and, if desired, phase information). In this way, alldesired frequencies may be calibrated (i.e., frequency-dependentvariations may be determined) and power-dependent (non-linear) behaviorscan be observed. The resulting calibration data for device 10 may bestored in storage in device 10 (see, e.g., storage and processingcircuitry 30).

At step 232, device 10 can be used by a user to handle wirelesscommunications. During normal operation, transmitter 130 can transmitpower at calibrated levels using the calibration information stored instorage and processing circuitry 30.

In some situations, after some or all of device 10 has been assembled(step 224), faults may arise that can disrupt wireless operations. As anexample, an antenna signal path may not be connected properly duringinitial device assembly operations or an antenna signal path may becomeloosened within device 10 during use (e.g., a cable connector or otherantenna signal connector may become loose when device 10 isinadvertently dropped by a user). FIG. 12 is a flow chart ofillustrative operations that may be performed to use phase and magnitudedata from coupler 136 (e.g., phase signals on line 170 and/or magnitudesignals on path 172) in running diagnostics on device 10 (whether fullyor partly assembled).

At step 234 of FIG. 12, a data capture routine may be initiated. As anexample, a data capture software program may be run on device 10 as partof a manufacturing diagnostic (e.g., a self-test routine initiated whenmanufacturing personnel select an on-screen option or when a wirelesscommand or wired command is transmitted to device 10) or personnel in aservice center may select an on-screen option on device 10 or mayotherwise initiate a diagnostics routine.

At step 236, as part of the diagnostics routine running on device 10,processor 132 may use coupler 136 to gather phase and/or magnitudeinformation for antenna 40 (e.g., impedance data). The captured data mayreveal that device 10 is operating normally (see, e.g., normal antennaresponse curve 218) or may reveal that device 10 contains a fault (see,e.g., faulty antenna response curve 220).

At step 238, processor 132 may evaluate the captured data or, ifdesired, other circuitry in device 10 or ancillary external processingcircuitry may evaluate the captured data. Appropriate action may then betaken based on the analyzed tapped antenna signal data. For example, ifit is determined that device 10 is operating properly, processor 132 orother equipment may issue a visual message, an audible alert, or othermessage for personnel running the diagnostic test to indicate thatdevice 10 has passed diagnostic testing. If it is determined that device10 contains a fault, personnel associated with the diagnostic test maybe informed the device 10 has failed testing and should be repaired,reworked, or discarded.

In some situations, diagnostic results will reveal that device 10 is notperforming properly (e.g., because antenna characteristic 220 isdetected instead of desired antenna characteristic 218), but it will notbe possible to pinpoint the nature of the problem (e.g., the problem maybe due either to a crack in a signal line or a crack in an antennatrace, but only visual inspection will reveal which of these twopossible faults is present).

In other situations, the diagnostic routine running on device 10 canprovide personnel associated with the test with more detailed testresults. As an example, the shape of an antenna performance curve thatis gathered may show that a particular antenna cable has beendisconnected. Whenever device 10 is able to identify what type ofproblem that has been detected, an alert message may be displayed bycontrol circuitry 30 on display 14 or other output may be provided thatinforms personnel running the diagnostic test of the nature of the testresults. As an example, a message may be displayed on display 14 thatcontains repair instructions such as “replace wireless transceiverboard” or “reconnect loose antenna flex” or that contains other detailedtest results.

During manufacturing, it may be possible to rework faulty parts. In arepair center environment, a faulty part may require device 10 to bereplaced or a more extensive repair may be made (e.g., by replacing afaulty printed circuit). Self-test diagnostic routines may, in general,be run in a factory setting or in a service-center setting or may be runby a user of device 10 (e.g., to determine whether device 10 requiresservicing by authorized service personnel).

The foregoing is merely illustrative and various modifications can bemade by those skilled in the art without departing from the scope andspirit of the described embodiments. The foregoing embodiments may beimplemented individually or in any combination.

What is claimed is:
 1. An electronic device, comprising: an antenna;wireless radio-frequency transceiver circuitry that transmitsradio-frequency signals at a transmit power level through the antenna; acoupler interposed in a path between the wireless radio-frequencytransceiver circuitry and the antenna that taps, from the path, theradio-frequency signals transmitted by the wireless radio-frequencytransceiver circuitry; a tapped signal path that carries the tappedradio-frequency signals from the coupler; a receiver in the wirelessradio-frequency transceiver circuitry that receives the tappedradio-frequency signals from the tapped signal path and that measuresthe tapped radio-frequency signals; and a processor that processes thetapped radio-frequency signals to produce S-parameter phase andmagnitude information, wherein the coupler comprises switching circuitryand the processor is configured to direct the switching circuitry toroute the tapped radio-frequency signals to the tapped signal path. 2.The electronic device defined in claim 1, wherein the radio-frequencysignals transmitted by the wireless radio-frequency transceivercircuitry reflect from the antenna, and the processor is configured todirect the switching circuitry to route a tapped version of thereflected transmitted radio-frequency signals to the tapped signal path.3. The electronic device defined in claim 2 wherein the switchingcircuitry comprises a first switch and a second switch, and the firstand second switches are controlled by the processor.
 4. The electronicdevice defined in claim 3 wherein the first switch has a first terminalcoupled to the tapped signal path, a second terminal coupled to a firstground termination, and a third terminal that receives the tappedversion of the reflected transmitted radio-frequency signals.
 5. Theelectronic device defined in claim 4 wherein the second switch has afirst terminal coupled to the tapped signal path, a second terminalcoupled to a second ground termination, and a third terminal thatreceives the tapped radio-frequency signals.
 6. The electronic devicedefined in claim 5 further comprising a double-pole-double throw switchinterposed between the antenna and the coupler.
 7. The electronic devicedefined in claim 6 wherein the processor sets a maximum level for thetransmit power level based on the phase and magnitude information. 8.The electronic device defined in claim 7 wherein the antenna comprisestunable components, and the processor adjusts the tunable components totune the antenna based on the phase and magnitude information.
 9. Theelectronic device defined in claim 1 wherein the antenna is detuned dueto an external object in the vicinity of the antenna, the antennacomprises tunable components, and the processor adjusts the tunablecomponents based on the phase and magnitude information to compensatefor the detuning due to the external object.
 10. The electronic devicedefined in claim 2, wherein the processor is configured to generate theS-parameter phase and magnitude information based on the tappedradio-frequency signals transmitted by the wireless radio-frequencytransceiver circuitry and based on the tapped version of the reflectedtransmitted radio-frequency signals.
 11. The electronic device definedin claim 10, wherein the S-parameter phase and magnitude informationcomprises an S-parameter value computed by the processor as a logarithmof the tapped version of the reflected transmitted radio-frequencysignals divided by the tapped radio-frequency signals transmitted by thewireless radio-frequency transceiver circuitry.
 12. The electronicdevice defined in claim 3, wherein the first switch is configured toroute the tapped version of the reflected transmitted radio-frequencysignals to the tapped signal path and the second switch is configured toroute the tapped radio-frequency signals transmitted by the wirelessradio-frequency transceiver circuitry to the tapped signal path.
 13. Theelectronic device defined in claim 1, wherein the processor comprises abaseband processor that generates the S-parameter phase and magnitudeinformation based on the tapped radio-frequency signals carried by thetapped antenna path.
 14. The electronic device defined in claim 5,wherein the first switch is configured to short the second terminal ofthe first switch to the third terminal of the first switch while thesecond switch shorts the first terminal of the second switch to thethird terminal of the second switch.
 15. The electronic device definedin claim 14, wherein the second switch is configured to short the secondterminal of the second switch to the third terminal of the second switchwhile the first switch shorts the third terminal of the first switch tothe first terminal of the first switch.
 16. The electronic devicedefined in claim 2, wherein the processor comprises a basebandprocessor, the electronic device further comprising: an additionalreceiver in the wireless radio-frequency transceiver circuitry; aduplexer having a first terminal coupled to the antenna and havingsecond and third terminals; and an adjustable switch having a firstinput coupled to the tapped signal path, a second input coupled to thesecond terminal of the duplexer, and an output coupled to the additionalreceiver, wherein the adjustable switch is controlled using a controlsignal to selectively couple one of the duplexer and the tapped signalpath to the additional receiver.
 17. The electronic device defined inclaim 16, further comprising: a transmitter in the wirelessradio-frequency transceiver circuitry; an amplifier interposed betweenthe transmitter and the third terminal of the duplexer; and additionalswitching circuitry coupled between the first terminal of the duplexerand the antenna, wherein the coupler is interposed between theadditional switching circuitry and the duplexer.
 18. The electronicdevice defined in claim 17, further comprising: an additional antenna;and a third receiver in the wireless radio-frequency transceivercircuitry, wherein the additional switching circuitry has first, second,third, and fourth terminals, the first terminal of the additionalswitching circuitry is coupled to the first terminal of the duplexerthrough the coupler, the second terminal of the additional switchingcircuitry is coupled to the third transceiver, the third terminal of theadditional switching circuitry is coupled to the antenna, and the fourthterminal of the additional switching circuitry is coupled to theadditional antenna.
 19. The electronic device defined in claim 2,wherein the antenna comprises antenna tuning circuitry, and theprocessor is configured to: reduce the transmit power level in responseto identifying, in the S-parameter phase and magnitude information, afirst amount of magnitude mismatch and a first amount of phase mismatchbetween the tapped version of the reflected transmitted radio-frequencysignals and the tapped radio-frequency signals transmitted by thewireless radio-frequency transceiver circuitry; and reduce the transmitpower level and adjust the antenna tuning circuitry in response toidentifying, in the S-parameter phase and magnitude information, asecond amount of magnitude mismatch and the first amount of phasemismatch between the tapped version of the reflected transmittedradio-frequency signals and the tapped radio-frequency signalstransmitted by the wireless radio-frequency transceiver circuitry,wherein the second amount of magnitude mismatch is greater than thefirst amount of magnitude mismatch.